import {createRouter, createWebHashHistory} from 'vue-router'
import Layout from '../layout/index.vue'
const router = createRouter({
  history: createWebHashHistory(), // hash模式：createWebHashHistory，history模式：createWebHistory
  routes: [
    {
      path: '/',
      redirect: '/dashboard'
    },
    {
      path: '/dashboard',
      name: 'dashboard',
      component: Layout,
      redirect: '/dashboard/three/cube',
      meta:{
        title: '仪表盘'
      },
      children:[
        // 这里是WebRTC部分
        {
          path: '/dashboard/camera',
          name: 'camera',
          component: ()=>import('../views/camera/index.vue'),
          meta:{
            title: '摄像头'
          }
        },
        {
          path: '/dashboard/micPhone',
          name: 'micPhone',
          component: ()=>import('../views/micphone/index.vue'),
          meta: {
            title: '麦克风'
          }
        },
        {
          path: '/dashboard/canvas',
          name: 'canvas',
          component: ()=>import('../views/canvas/index.vue'),
          meta: {
            title: '画板截屏'
          }
        },
        {
          path: '/dashboard/screenShare',
          name: 'share',
          component: ()=>import('../views/screenShare/index.vue'),
          meta: {
            title: '屏幕共享'
          }
        },
        {
          path: '/dashboard/videoFilter',
          name: 'filter',
          component: ()=>import('../views/videoFilter/index.vue'),
          meta: {
            title: '视频滤镜'
          }
        },
        {
          path: '/dashboard/resolution',
          name: 'resolution',
          component: ()=>import('../views/resolution/index.vue'),
          meta:{
            title: '动态分辨率'
          }
        },
        {
          path: '/dashboard/dynamicResolution',
          name: 'dynamicResolution',
          component: ()=>import('../views/resolution/dynamic.vue'),
          meta: {
            title: '无缝调整分辨率'
          }
        },
        {
          path: '/dashboard/AudioVolume',
          name: 'AudioVolume',
          component: ()=>import('../views/volume/index.vue'),
          meta: {
            title: '音量值测算'
          }
        },
        {
          path: '/dashboard/deviceEnum',
          name: 'deviceEnum',
          component: ()=>import('../views/device/index.vue'),
          meta: {
            title: '设备枚举'
          }
        },
        {
          path: '/dashboard/setting',
          name: 'settingsDemo',
          component: ()=>import('../views/settings/index.vue'),
          meta: {
            title: '设置综合案例'
          }
        },
        // 结束
        // Threejs部分开始
        {
          path: '/dashboard/three/cube',
          name: 'Cube',
          component: ()=>import('../views/three/cube.vue'),
          meta: {
            title: '方块旋转'
          }
        },
        {
          path: '/dashboard/three/line',
          name: 'Line',
          component: ()=>import('../views/three/Line.vue'),
          meta: {
            title: '线条'
          }
        },
        {
          path: '/dashboard/three/text',
          name: 'Text',
          component: ()=>import('../views/three/Text.vue'),
          meta: {
            title: '文字'
          }
        },
        {
          path: '/dashboard/three/basicLine',
          name: 'BasicLine',
          component: ()=>import('../views/three/material/BasicLineMaterial.vue'),
          meta: {
            title: '基础线材质'
          }
        },
        {
          path: '/dashboard/three/point',
          name: 'Point',
          component: ()=>import('../views/three/material/PointsMaterial.vue'),
          meta: {
            title: '点材质'
          }
        },
        {
          path: '/dashboard/three/lineDashed',
          name: 'LineDashed',
          component: ()=>import('../views/three/material/LineDashedMaterial.vue'),
          meta: {
            title: '虚拟线材质'
          }
        },
        {
          path:'/dashboard/three/MeshBasic',
          name: 'MeshBasic',
          component: ()=>import('../views/three/material/MeshBasicMaterial.vue'),
          meta: {
            title: '网格线材质'
          }
        },
        {
          path: '/dashboard/three/texture',
          name: 'Texture',
          component: ()=>import('../views/three/material/TextureMaterial.vue'),
          meta: {
            title: '材质贴图'
          }
        },
        {
          path: '/dashboard/three/wireFrame',
          name: 'WireFrame',
          component: ()=>import('../views/three/material/WireframeMaterial.vue'),
          meta: {
            title: '网格几何体'
          }
        }
      ]
    }
  ]
})

export default router
